<?php

	/*==================================/*
	*| DuyK - admin@daica.info
	*| This is Page view shop
	/*==================================*/
	
	include('dtc_global.php');
	
	/*==================================/*
	*| DuyK - admin@daica.info
	*| Phan Lay du lieu de dua vao template
	/*==================================*/
	
		// Lay thong tin chu shop
		$user_info = @$dtc_do->load('class_member')->user_info_by_username('user_id,shop', $_REQUEST['username']);
			
			if(empty($user_info['shop']))
				{
				exit('Shop khong ton tai');
				}
				

		// Lay thong tin san pham tu cua hang
		$class_shop = $dtc_do->load('class_shop');
		
		// Lay thong tin san pham
		$class_sanpham = $dtc_do->load('class_sanpham');
		
	/*==================================/*
	*| DuyK - admin@daica.info
	*| Goi va xu ly template
	/*==================================*/	
		
		// List san pham
		foreach($class_shop->shop_rieng_info($user_info['user_id']) as $shop_rieng_info)
			{
				foreach($class_shop->list_san_pham_shop_rieng(1,10,$user_info['user_id'],$shop_rieng_info['id']) as $list_rieng)
					{
						$list_san_pham_rieng .= $dtc_template->template_replace($user_info['shop'].'/box_sanpham', $list_rieng);
					}
				$list_danh_muc .= $dtc_template->template_replace($user_info['shop'].'/box_chuyenmuc', array(
				'tieu_de' => $shop_rieng_info['tieu_de'],
				'list_san_pham' => $list_san_pham_rieng
				) );
				unset($list_san_pham_rieng);
			}
		
		// Tao array cho template
			
			// Array body 
			$array_body = array(
			'list_danh_muc' => $list_danh_muc
			);
		
		// Nhap vao template
		echo $dtc_template->template_normal($user_info['shop'].'/header');
		echo $dtc_template->template_replace($user_info['shop'].'/body', $array_body);
		echo $dtc_template->template_normal($user_info['shop'].'/footer');
?>













